// PCControl.h : main header file for the PCControl DLL
//

#pragma once

#ifndef __AFXWIN_H__
	#error "include 'stdafx.h' before including this file for PCH"
#endif

#include "resource.h"		// main symbols

#include "CProcess.h"
#include "Hooker.h"
#include "SystemInfoGrid.h"
#include "WmiInfo.h"
#include "ProcessList.h"

#include "Iphlpapi.h"
#pragma comment(lib, "Iphlpapi.lib")

#define DLLExport extern "C" _declspec(dllexport)

#define SHUTDOWN	EWX_SHUTDOWN
#define REBOOT		EWX_REBOOT
#define FORCE		EWX_FORCE

#define TYPE_COMMAND	0x0001
#define TYPE_DATA		0x0002

#define ALL_CLIENT			0x0010
#define SPECIFIC_CLIENT		0x0020
#define ONE_CLIENT			0x0040
#define SPECIFIC_PROCESS	0x0080

#define REQUEST_PROCESS		0x00000001L
#define REQUEST_SYSINFO		0x00000002L  
#define RESPOND_PROCESS		0x00000010L


#define REQUEST_RESTART		0x00000020L
#define REQUEST_SHUTDOWN	0x00000040L

#define REQUEST_INJECT		0x00000080L
#define REQUEST_UNINJECT	0x00000100L

typedef struct tagPackageHead
{
	int nType;
	DWORD dwCommand;
	DWORD dwSize;

}PackageHead, *PPackageHead;

template <class T> struct tagPackage  
{
	DWORD dwFlag;
	T Packet;
};

typedef struct
{
	DWORD dwCommand;
	union pack
	{
		PROCESS_INFO_NET_ALL stAllInfo;

	}info;
}Package;


// CPCControlApp
// See PCControl.cpp for the implementation of this class
//

class CPCControlApp : public CWinApp
{
public:
	CPCControlApp();

// Overrides
public:
	virtual BOOL InitInstance();

	DECLARE_MESSAGE_MAP()
};

DLLExport BOOL SystemShutdown(UINT nCommand);
DLLExport void   SystemCMD(CString szCommand);
DLLExport DWORD WakeUp(CString szMAC);
DLLExport BOOL RunProcess(LPTSTR szProgram, DWORD dwCreationFlags = NORMAL_PRIORITY_CLASS);
DLLExport BOOL ForceKillProcess(LPTSTR proc);
DLLExport BOOL NormalKillProcess(LPTSTR proc);
DLLExport DWORD GetPID (LPTSTR proc);
DLLExport BOOL GetMAC(LPSTR lpszAddr, LPTSTR lpszMAC);